package com.java.crazy.part1.类型;

import com.java.crazy.base.BaseClass;

public class FloatTest extends BaseClass {
    public static void main(String[] args) {
        logi("Float：");
        Main();
    }

    public static void Main() {
        float af = 5.23455569f;

        //下面将看到af的值已经发生了改变System.out.println(af) ;
        double a = 0.0;
        float a1 = 0.0f;
        double c = Double.NEGATIVE_INFINITY;
        float d = Float.NEGATIVE_INFINITY;//看到float和double的负无穷大是相等的
        logi(af);
        logi(a1 / a1);//两个非数之间是不相等的
        logi(c == d);// 0.0除以0.0将出现非数
        logi((a1 / a1) == Float.NaN);//所有正无穷大都是相等的

        logi(6.0 / 0 == 555.0 / 0);//负数除以0.0得到负无穷大

        logi(-8 / a);//下面代码将抛出除以0的异常

        // System.out.println(0 /0);

    }
}
